package com.rfsp.mcp.service;

import com.rfsp.common.base.BaseService;
import com.rfsp.mcp.pojo.dto.FlowDTO;
import com.rfsp.mcp.pojo.po.FlowPO;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Service
public class FlowService extends BaseService<FlowPO> {
    @Transactional(propagation= Propagation.REQUIRES_NEW)
    public Integer create(FlowDTO dto){
        FlowPO po=new FlowPO();
        BeanUtils.copyProperties(dto,po);
        Integer count=0;
        try {
            count=this.save(po);
        } catch (Exception e1) {
            e1.printStackTrace();
        }
        return count;
    }
}
